<%-- 
    Document   : UpdateCollection
    Created on : Jul 11, 2011, 7:23:07 PM
    Author     : Hai
--%>

<%@page import="server.process.ProcessBeanLocal"%>
<%@page import="server.entity.Category"%>
<%@page import="javax.naming.InitialContext"%>
<%@page import="javax.naming.Context"%>
<jsp:include page="adminheader.jsp"></jsp:include>
            <div id="main">
                <div id="adminManager">
                   <jsp:include page="lefmenu.jsp"></jsp:include>
                </div>
                <div id="contentAdmin">
                    <fieldset>
                        <legend>Collection Name</legend>
                        <form action="doUploadCategory" method="POST" enctype="multipart/form-data">
                        <h2>update Collection</h2>
                        <%
                            String id = request.getParameter("id");
                            System.out.println(id);
                            Context ctx = new InitialContext();
                            ProcessBeanLocal local = (ProcessBeanLocal) ctx.lookup("ProcessLocalJNDI");
                            Category category=local.findbyCollectionID(id);
                        %>
                        <table border="0">
                            <tr>

                                <td>Collection Name</td>

                                <td><input type="text" name="txtColName" value="<%=category.getCollectionName()%>"/>
                            </tr>
                            <tr>
                                <td>Description:</td>
                                <td><input type="text" name="txtDescription" value="<%=category.getCollectionDescription()%>"/>
                            </tr>
                            <tr>
                                <td>Collection Image</td>
                                <td>
                                    <input type="file" name="image" value="" />
                                    <input type="hidden" name="ktimage" value="<%= category.getImage() %>"/>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <input type="hidden" value="<%=id%>" name="id"/>
                                    <input type="hidden" name="fromPage" value="updatecolectionAdmin"/>
                                    <input type="submit" name="action" value="Create"/></td>
                                <td><input type="reset" name="reset" value="Cancel"/></td>
                            </tr>
                        </table>
                    </form>
                    </fieldset>
                </div>
            </div>
            <div id="footer">

            </div>
        </div>
    </body>
</html>
